<?php
class DatabaseFormatter implements RedBean_IModelFormatter {

    public function formatModel($model) {
        if (file_exists(Config::$rootPath . 'models/' . $model . '.php')) {
            require_once Config::$rootPath . 'models/' . $model . '.php';
        }
        return $this->camelize($model);
    }

    public function camelize($value) {
        $replace = str_replace(" ", "", ucwords(str_replace("_", " ", $value)));
        return $replace;
    }

}
?>
